home *** CD-ROM | disk | FTP | other *** search
- /* © 1988, Bowers Development Corp. */
- /* Startup.c */
-
- #include "Globals.h"
- #include "ResourceDefs.h"
- #include "EventLoop.h"
- #include "FileM.h"
- #include "Miscellany.h"
-
- short finderMessage;
- short nrDocs;
-
- /*----------*/
- short main (void);
- void PrintDocuments (void);
- void OpenDocuments (void);
-
- /*----------*/
- short main ()
- {
- Initialize ();
- CountAppFiles (&finderMessage, &nrDocs);
- if (finderMessage == appPrint) {
- PrintDocuments ();
- } else {
- OpenDocuments ();
- MainLoop ();
- }
- } /*Startup*/
-
- /*----------*/
- void PrintDocuments ()
- {
- Acknowledge (CantPrintID);
- } /*PrintDocuments*/
-
- /*----------*/
- void OpenDocuments ()
- {
- short n;
- short nrOpened;
- AppFile docInfo;
-
- nrOpened = 0;
- for (n = 1; n <= nrDocs; n++) {
- GetAppFiles (n, &docInfo);
- if (OkToOpen (docInfo.fType)) {
- OpenFile (docInfo.fName, docInfo.vRefNum);
- nrOpened++;
- } else {
- ParamText (docInfo.fName, "", "", "");
- Acknowledge (WrongTypeID);
- }
- ClrAppFiles (n);
- } /*for*/
- if (nrOpened == 0) {
- Open0Files ();
- }
- } /*OpenDocuments*/
-
-